<template>
  <div id="app">
    <router-view/>
  </div>

</template>

<script>
export default {
  methods: {
    bubleCreate: () => {
      // 获取body元素
      const body = document.body
      // 创建泡泡元素
      const buble = document.createElement('span')
      buble.className = 'mask';
      // 设置泡泡半径
      let r = Math.random() * 5 + 15 //半径大小为25~30
      // 设置泡泡的宽高
      //  console.log(r,"r")
      buble.style.width = r + 'px'
      buble.style.height = r + 'px'
      // 设置泡泡的随机起点
      // console.log( Math.random(),innerWidth)
      buble.style.left = Math.random() * (innerWidth -40) + 'px'
      // 为body添加buble元素
      body.append(buble)
      // 4s清除一次泡泡
      setTimeout(() => {
        buble.remove()
      }, 4000)
    }
  },
  created() {
    // 每200ms生成一个泡泡
    setInterval(this.bubleCreate, 200);

  }
}

</script>
<style lang="less"  >
#app {
  //overflow: hidden;
  position: relative;
  text-align: center;
  z-index: 6;
}
///deep/.home{
//  z-index: 1;
//}
.mask {
  position: absolute;
  bottom: 0;
  z-index: 0;
  background: radial-gradient(circle at 72% 28%, #fff 3px, #ff7edf 8%, #5b5b5b, #aad7f9 100%);
  box-shadow: inset 0 0 6px #fff,
  inset 3px 0 6px #eaf5fc,
  inset 2px -2px 10px #efcde6,
  inset 0 0 60px #f9f6de,
  0 0 20px #fff;
  border-radius: 50%;
  animation: myMove 4s linear infinite;
  transition: 2s;
}

@keyframes myMove {
  0% {
    transform: translateY(0%);
    opacity: 1;
  }

  50% {
    transform: translate(10%, -1000%);
  }

  75% {
    transform: translate(-20%, -1200%);
  }

  99% {
    opacity: .9;
  }

  100% {
    transform: translateY(-1800%) scale(1.5);
    opacity: 0;
  }
}
</style>

